package EnumTest;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

import static java.lang.Class.forName;

public class Test {
    public static void main(String[] args) {
        try{
            Class<?> c = Class.forName("EnumTest.TestEnum");

             Constructor constructor = c.getDeclaredConstructor(String.class , int.class , String.class, int.class );
             constructor.setAccessible(true);

             TestEnum testEnum = (TestEnum)constructor.newInstance("ffff",9,"white",10);

            System.out.println(testEnum);

        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
